package cn.tedu.travelsystem.order.pojo.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
public class Order {
    private int orderId;                // 订单ID
    private int userId;                 // 用户ID
    private BigDecimal totalAmount;     // 订单总金额
    private String orderStatus;    // 订单状态
    private Date  createTime;   // 创建时间
    private String paymentMethod;       // 支付方式
    private String transactionId;       // 交易流水号

    public enum OrderStatus {
        UNPAID(0, "待支付"),
        COMPLETED(1, "已完成"),
        CANCELED(2, "已取消");

        private final int code;
        private final String description;

        OrderStatus(int code, String description) {
            this.code = code;
            this.description = description;
        }

        public int getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }
}
